// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

import ComponentBase from "../../../TS/BASE/ComponentBase";
import { gif } from "../../../TS/BASE/spineANDgif/gif";
import { Message } from "../../../TS/Message/Message";

const {ccclass, property} = cc._decorator;

@ccclass
export default class MTX extends ComponentBase {
@property(gif)
    XUQI:gif=null;
    @property(gif)
    CURE:gif=null;
    @property(gif)
    ICE:gif=null;
    @property(gif)
    TP:gif=null;
    @property(gif)
    THUNDER:gif=null;
    @property(gif)
    water:gif=null;
    @property(gif)
    Dun:gif=null;
    @property(gif)
   turn:gif=null;
    @property(gif)
    BA:gif=null;
    @property(gif)
   TN:gif=null;
   @property(gif)
   FuG:gif=null;
onLoad(): void {
    this.XUQI.timeArray=[60,60,60,58,58,58,80,98,47,55,60,90,90,90,90]
    this.CURE.timeArray=[65,65,60,65,65,65,80,98,47,55,60,90,90,90,90]
    this.ICE.timeArray=[60,60,60,58,58,58,80,98,47,55,60,90,90,90,90]
  
 //this.THUNDER.timeArray=[60,40,35,35,70,40,65,98,47,55,60,90,90,90,90]
    //this.XUQI.timeArray=[60,60,60,58,58,58,80,98,47,55,60,90,90,90,90]
}


playFrameAnimation1(n:string) {
   switch (n) {
    case "xuqi":this.XUQI.moveToNextFrame(0,15,1)
        
        break;
        case "cure":this.CURE.moveToNextFrame(0,7,1)
        
        break;
        case "ice":this.ICE.moveToNextFrame(0,6,0)
        
        break;
        case "iceN":this.ICE.moveTolastFrame(6,0,1);//this.fadeOutAndDisappear(this.ICE.node,1200)
        
        break;
        case "thunder":this.THUNDER.moveToNextFrame(0,6,1);//console.log(this.THUNDER)//this.fadeOutAndDisappear(this.ICE.node,1200)
        
        break;
        case "Dun":this.Dun.moveToNextFrame(0,4,1)
        
        break;
        case "BA":this.BA.moveToNextFrame(0,7,1)
        
        break;
        case "turn4":this.node.scaleX=-1;this.turn.moveToNextFrame(0,4,1);
        
        break;
        case "turn6":this.node.scaleX=1;this.turn.moveToNextFrame(0,3,1);
        
        break
        case "water":this.fadeINAndA(this.water.node.parent,500);this.water.kk=true;this.water.loopF(0,3,0);//this.fadeOutAndDisappear(this.ICE.node,1200)
        
        break;
        case "waterE":this.fadeOutAndDisappear(this.water.node.parent,500);//this.water.loopF(0,4,0);//this.fadeOutAndDisappear(this.ICE.node,1200)
        
        break;
        case "TN":this.TN.moveToNextFrame(0,6,1);//console.log(this.THUNDER)//this.fadeOutAndDisappear(this.ICE.node,1200)
        
        break;
    default:
        break;
   }
 }

}
